#ifndef _MOTOR_H_
#define _MOTOR_H_

/******* includes **********/
#include "pwm.h"


/******* defines ***********/
#define Motor(Id,val)  {\
                           sint16 PwmValue = (val);\
                           if (PwmValue < 0) \
                           {\
                               PwmValue = 0;\
                           }\
                           Pwm_SetValue(Id, (uint16)PwmValue)\
                       }

#define MotorA(val)  Motor(0, (val))
#define MotorB(val)  Motor(1, (val))
#define MotorC(val)  Motor(2, (val))
#define MotorD(val)  Motor(3, (val))

// View of the motors with axis from the top.
//
//  x     B     y
//        |
//        |
//  A ----z-----C
//        |
//        |
//        D


#endif

